#!/bin/bash

eval $(xdotool getdisplaygeometry --shell)

#guake -e 'screen -ddr work'

#active=$(xdotool getactivewindow)
#name=$(xdotool getwindowname active)

name="$(whoami)@$(cat /etc/hostname)"
win=$(xdotool search "$name")
if [ -z "$win" ]; then
    xterm -fa 'Monospace' -fs 14 &
    win=$(xdotool search --sync "$name")
fi

width=$(xdotool getwindowgeometry $win | grep Geo | sed 's/.*x//')
height=$(xdotool getwindowgeometry $win | grep Geo | sed 's/x.*//;s/[^0-9]*//')
xdotool windowsize --sync $win $height $width

#xdotool getwindowgeometry $win $height $width
